package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JSONUtil;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

@Setter@Getter
public class Hotel extends BaseDomain{

    private static final int COMMEND_DOWN = 0;   //不推荐
    private static final int COMMEND_NORMAL = 1;  //正常
    private static final int COMMEND_UP = 2;  //推荐

    private String name;  //名称

    private String coverUrl;  //封面

    private Integer state = COMMEND_UP;  //状态:推荐

    public String getStateName(){
        String msg = "推荐";
        if(state == COMMEND_DOWN){
            msg = "不推荐";
        }else if(state == COMMEND_NORMAL){
            msg = "正常";
        }
        return msg;
    }

    public String getJson(){
        Map map = new HashMap();
        map.put("id",id);
        map.put("name",name);
        map.put("coverUrl",coverUrl);
        map.put("state",state);
        return JSONUtil.toJSONString(map);
    }
}